package 数据结构和算法.算法.递归.求和;

public class Sum {
    public static void main(String[] args) {
        System.out.println(sum(2));
    }

    public static int sum(int value) {
        if (value == 1) {
            return 1;
        } else {
            return value + sum(value - 1);
        }
    }
}
